// API 通用响应格式
export interface ApiResponse<T = any> {
  message: string | null;
  data: T;
}

// 头像上传响应
export interface AvatarUploadResponse {
  avatar_url: string;
}

// 用户注册请求体（邮箱已改为可选项，注册时不再需要填写）
export interface RegisterRequest {
  username: string;
  password: string;
  password_confirm: string;
  invitation_code: string;
}

// 用户注册响应
export interface RegisterResponse {
  username: string;
  message: string;
}

// 用户资料
export interface UserProfile {
  id?: number;
  username?: string;
  email?: string;
  admin_type?: string;
  avatar?: string;
  real_name?: string;
  blog?: string;
  mood?: string;
  github?: string;
  school?: string;
  major?: string;
  language?: string;
  submission_number?: number;
  accepted_number?: number;
  has_profile?: boolean;  // 是否有个人资料
  message?: string;  // 提示信息
}

// 错误响应
export interface ApiError {
  msg: string;
  data: {
    [key: string]: string[];
  };
}

// User type with admin_type
export interface User {
  id: number;
  username: string;
  admin_type: string;
  avatar?: string | null;
  notifications?: number;
  // Add other user properties as needed
}

// 登录请求体
export interface LoginRequest {
  username: string;
  password: string;
}

// 登录响应
export interface LoginResponse {
  token: string;
  user: User;
}

// 登录错误响应
export interface LoginError {
  non_field_errors?: string[];
}

// 邀请码类型定义
export interface InvitationCode {
  id: number;
  code: string;
  created_by: number;
  created_by_username: string;
  create_time: string;
  is_used: boolean;
  used_by: number | null;
  used_by_username: string | null;
  used_time: string | null;
}

export interface CreateInvitationCodeRequest {
  count: number;
}

export interface CreateInvitationCodeResponse {
  data: InvitationCode[];
}



// 团队相关类型定义
export interface Team {
  id: number;
  name: string;
  description: string;
  creator: number;
  creator_name: string;
  member_count: number;
  is_active: boolean;
  created_time: string;
}

export interface TeamMember {
  id: number;
  user: number;
  username: string;
  email: string;
  joined_time: string;
}

export interface CreateTeamRequest {
  name: string;
  description: string;
  password: string;
}

export interface UpdateTeamRequest {
  name: string;
  description: string;
  password: string;
}

export interface JoinTeamRequest {
  team_id: number;
  password: string;
}



 